package com.nacos.temp3.client.service;

import com.nacos.temp3.client.fallback.OrderApiFallbackFactory;
import com.nacos.temp3.support.domain.Product;
import com.nacos.temp3.support.response.BaseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "potyun-order-service", path = "/api/order", fallbackFactory = OrderApiFallbackFactory.class, contextId = "orderApi")
public interface OrderApiClient {

    @GetMapping("/list")
    BaseResult<List<Product>> productList();

    @GetMapping("/get/{key}")
    BaseResult<Product> get(@PathVariable("key") Object primaryKey);

}
